//
//  DYNewViewController.m
//  BaiSi
//
//  Created by mac on 16/10/14.
//  Copyright © 2016年 DeYi. All rights reserved.
//

#import "DYNewViewController.h"
#import "DYTSubViewController.h"
#import "DYAllViewController.h"
#import "DYVideoViewController.h"
#import "DYVoiceTableViewController.h"
#import "DYPhotoViewController.h"
#import "DYTextViewController.h"


@interface DYNewViewController ()

@end

@implementation DYNewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //设置导航栏按钮
    [self setUpNavigationItemButton];
    
    //添加子控制器
    [self addChiledTitleViewcontrollers];
}

#pragma mark 设置导航栏按钮
- (void)setUpNavigationItemButton {
    //左边
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"MainTagSubIcon"] highImage:[UIImage imageNamed:@"MainTagSubIconClick"] target:self action:@selector(recomend)];
    

    
    //中间
    self.navigationItem.titleView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MainTitle"]];
}

#pragma mark - 导航条点击事件
- (void)recomend {
    LHLog(@"点击推荐");
    DYTSubViewController *subVc = [[DYTSubViewController alloc] init];
    [self.navigationController pushViewController:subVc animated:YES];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - 添加子控制器
- (void)addChiledTitleViewcontrollers {
    //全部
    DYAllViewController *allVc = [[DYAllViewController alloc] init];
    allVc.view.frame = [UIScreen mainScreen].bounds;
    allVc.title = @"全部";
    [self addChildViewController:allVc];
    
    //视频
    DYVideoViewController *videoVc = [[DYVideoViewController alloc] init];
    videoVc.view.frame = [UIScreen mainScreen].bounds;
    videoVc.title = @"视频";
    [self addChildViewController:videoVc];
    
    //声音
    DYVoiceTableViewController *voiceVc = [[DYVoiceTableViewController alloc] init];
    voiceVc.view.frame = [UIScreen mainScreen].bounds;
    voiceVc.title = @"声音";
    [self addChildViewController:voiceVc];
    
    //图片
    DYPhotoViewController *photoVc = [[DYPhotoViewController alloc] init];
    photoVc.view.frame = [UIScreen mainScreen].bounds;
    photoVc.title = @"图片";
    [self addChildViewController:photoVc];
    
    //段子
    DYTextViewController *textVc = [[DYTextViewController alloc] init];
    textVc.view.frame = [UIScreen mainScreen].bounds;
    textVc.title = @"段子";
    [self addChildViewController:textVc];
    
}

@end
